using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediatR;
using RBAC.ErrorCode;

namespace RBAC.Write.Api.Application.Command.ERP.SalesManagement.Return
{
    /// <summary>
    /// 更新退货通知单命令
    /// </summary>
    public class UpdateReturnNoticeCommand : IRequest<APIResult<int>>
    {
        /// <summary>
        /// 退货通知单ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 单据编码
        /// </summary>
        public string BillCode { get; set; } = string.Empty;

        /// <summary>
        /// 单据日期
        /// </summary>
        public DateTime BillDate { get; set; }

        /// <summary>
        /// 业务类型
        /// </summary>
        public string BusinessType { get; set; } = string.Empty;

        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; } = string.Empty;

        /// <summary>
        /// 销售员
        /// </summary>
        public string Operator { get; set; } = string.Empty;

        /// <summary>
        /// 业务状态
        /// </summary>
        public int BusinessStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 退货物料明细
        /// </summary>
        public List<ReturnMaterialDto> Items { get; set; } = new();
    }

    /// <summary>
    /// 退货物料DTO
    /// </summary>
    public class ReturnMaterialDto
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; } = string.Empty;

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; } = string.Empty;

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; } = string.Empty;

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 退货数量
        /// </summary>
        public decimal ReturnQuantity { get; set; }

        /// <summary>
        /// 批号
        /// </summary>
        public string BatchNumber { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;
    }
}